package top.yamhk.plugin.feign;

import org.springframework.context.annotation.Lazy;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * , configuration = FeignFormClientConfig.class
 *
 * @author 谢 YamHK
 */
@Lazy
//@FeignClient(value = "localhost", url = "${url.localhost.mac:/}")
public interface DemoFeignByUrl {

    /**
     * 永久-信用卡(dep)
     * dev-/v1/hk/agent/post/{id}
     * sit-/activity/m/{id}
     * cc-sit-/ac/view
     * cc-sit-/ac/join
     *
     * @param accessToken accessToken
     * @param id          id
     * @return Object
     */
    @GetMapping("/ac/view")
    Object doView(@RequestHeader("accessToken") String accessToken, @RequestParam(value = "id") String id);

    @PostMapping("/ac/join")
    Object doJoin(@RequestHeader("accessToken") String accessToken, @RequestParam(value = "id") String id, @RequestBody Map<String, String> requestBody);

    @GetMapping(value = "/mgm/img", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Object doDownload(@RequestHeader("accessToken") String token, @RequestParam("imgSeq") String finder);

    @PostMapping(value = "/cn/img", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Object doUpload(@RequestHeader("accessToken") String token, @RequestPart(name = "file") MultipartFile file, @RequestParam("mid") String mid);
}